import web
import os
        
urls = (
    '/name=(.*)&age=(.*)', 'hello',
    '/admin/(.*?)','admin'
)
app = web.application(urls, globals())
app_root = os.path.dirname(__file__)
templates_root = os.path.join(app_root, 'html')
render = web.template.render(templates_root)

class hello:        
    def GET(self, name, age):
        return render.index(name, age)
    
class admin:
    def GET(self, name):
        if name:
            return 'welcome,%s'%(name)
        else:
            return 'welcome, admin'
if __name__ == "__main__":
    app.run()